﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Education
{
    public class Student
    {
        public Student()
        {
            
        }
        public Student(string name, Address address, University university, Faculty faculty)
        {
            Id = Guid.NewGuid();
            FullName = name;
            Address = address;
            University = university;
            
            //TODO: use lambda expresions to find faculty
            foreach (var f in University.Faculties)
            {
                if (f == faculty)
                {
                    Faculty = faculty;
                }
            }

            //TODO: throw FacultyMismatch exception if Faculty is null
        }
        public Guid Id { get; private set; }
        public string FullName { get; set; }
        public Address Address { get; set; }
        public University University { get; set; }
        public Faculty Faculty { get; set; }
        public override string ToString()
        {
            return String.Format("[{0}] {1}, {2}, {3}", Id, FullName, University.Name, Faculty.Name);
        }
    }
}
